package com.zh.rent.service.impl;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.zh.rent.dao.StanAccountDao;
import com.zh.rent.pojo.StandbyAccount;
import com.zh.rent.service.StanAccountService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Isolation;
import org.springframework.transaction.annotation.Transactional;

import java.util.List;
import java.util.Map;

@Service
@Transactional(isolation = Isolation.READ_COMMITTED)
public class StanAccountServiceImpl implements StanAccountService {
    @Autowired
    StanAccountDao stanAccountDao;
    @Override
    public int insertaccountsAll(List<StandbyAccount> list) {
        return stanAccountDao.insertaccountsAll(list);
    }

    @Override
    public int insertaccounts(StandbyAccount account) {
        return stanAccountDao.insertaccounts(account);
    }

    @Override
    public PageInfo<StandbyAccount> selaccountAll(Integer pageNum, Integer pageSeiz, Map<String, Object> map) {
        PageHelper.startPage(pageNum,pageSeiz);
        List<StandbyAccount> list = stanAccountDao.selStanAccAll(map);
        return new PageInfo<>(list);
    }

    @Override
    public int updateaccount(StandbyAccount stanaccount) {
        return stanAccountDao.updateaccount(stanaccount);
    }

    @Override
    public int delAccBccAll(List<Integer> list) {
        return stanAccountDao.delAccBccAll(list);
    }

    @Override
    public int delAccBccid(Integer Accountid) {
        return stanAccountDao.delAccBccid(Accountid);
    }

    @Override
    public int updateaccountStart(Integer Standbyid, Integer start) {
        return stanAccountDao.updateaccountStart(Standbyid,start);
    }

    @Override
    public StandbyAccount selStanAcc(Integer Standbyid) {
        return stanAccountDao.selStanAcc(Standbyid);
    }

    @Override
    public StandbyAccount selStanAccint(String AccountType) {
        return stanAccountDao.selStanAccint(AccountType);
    }
}
